/* 
 * Distributed as part of jdiff
 * 
 * Copyright (C) 2008 QArks.com
 *
 * Author: Pierre Meyer <support@qarks.com>
 *
 * This library is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 2.1, as 
 * published by the Free Software Foundation.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
 * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
 * USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 * The above copyright notice and this permission notice shall be included
 * in all copies or substantial portions of the Software.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this software; see the file LICENSE.  If not, write to the
 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 * Boston, MA 02111-1307, USA.
 */
package diff.misc;

import java.util.ArrayList;

public class ParsedFile {

    private FileLine lines[];

    public ParsedFile(String fileContent) {
        String[] fileLines = fileContent.split("\r\n|\n|\r");
        lines = new FileLine[fileLines.length];
        for(int i=0;i<fileLines.length;i++){
            lines[i] = new FileLine(fileLines[i],i);
        }
    }

    public ParsedFile(ArrayList lineArray){
        lines = new FileLine[lineArray.size()];
        for(int i=0;i<lineArray.size();i++){
            lines[i] = (FileLine)lineArray.get(i);
        }
    }

    public ParsedFile(FileLine lines[]){
      this.lines = lines;
    }

    public FileLine[] getLines(){
        return lines;
    }
}
